﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using DAL.DateSet.TableMappingTableAdapters;
using DAL.DateSet;
using DAL;
namespace BLL.Wrapper
{
    public class TableMappingWrapper : TableMappingTableAdapter
    {

        public TableMapping.TableMappingDataTable getall()
        {
            return GetData();
        }

        public void addARecord(TableMapping.TableMappingRow row)
        {
            Insert(row.mainTable, row.tablePK, row.foreignTable, row.tableFk);
        }

        public void deleteByID(int id)
        {
            string sql = "delete from ModifyRecord where tableMappingID = " + id.ToString();
            HouseDiyHelper helper = HouseDiyHelper.GetInstance();
            helper.initOle();
            helper.delete(sql);
        }
    }
}
